package ${cfg.ModulePackage}.${cfg.SwaggerConfigPackageName};

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * ${cfg.ModuleName?cap_first}-${cfg.ModuleDesc} Swagger2接口文档配置
 *
 * @author ${author}
 * @since ${date}
 */
@Configuration
public class ${cfg.ModuleName?cap_first}${cfg.SwaggerConfigName} {

	/**
     *包接口位置
     */
	private static final String INTERFACE_PACKAGE="${package.Controller}";

	@Bean
	public Docket ${cfg.ModuleName}Api() {
		return new Docket(DocumentationType.SWAGGER_2)
				.groupName("${cfg.ModuleName?cap_first}-${cfg.ModuleDesc}-接口集")
				.apiInfo(apiInfo())
				.select()
				.apis(RequestHandlerSelectors.basePackage(INTERFACE_PACKAGE))
				.paths(PathSelectors.any())
				.build();
	}

	private ApiInfo apiInfo() {
		return new ApiInfoBuilder()
				.title("MKTail的api文档-${cfg.ModuleName?cap_first}-${cfg.ModuleDesc}")
				.description("MKTail接口文档详细信息-${cfg.ModuleDesc}")
				.termsOfServiceUrl("")
				.version("1.0")
				.build();
	}

}
